Setting up Jenkins pipeline job in Rundeck 3.4.9 community version

I want to setup a Jenkins pipeline job which should be triggered by Rundeck. I have already created a Jenkins Pipeline job in Jenkins which is working fine. Now , my requirement is that the same Jenkins job should be triggered by Rundeck. I am using Rundeck 3.4.9 community version.

So can someone please guide how can i setup a Jenkins job in Rundeck and what configurations i need to do on both Rundeck and Jenkins end ? Quick response is much appreciated.

Regards Shantanu

Hi Shantanu,

For Rundeck related cases, please use this subforum. Anyway, take a look at this answer and this Google Groups thread.

Greetings.

Hope it helps!

1 Like

@reiner.acuna Thanks for your reply…

I have gone through the link which you provided but its not much explained in detail… So Could you please help me with steps of setting up Jenkins job in Rundeck , as i am very new to Rundeck so i am having many doubts and confusions.
Quick response is appreciated.

Hi Shantanu,

I made a quick test environment.

  1. From the Jenkins side, with a new user token and a new job.
  2. From Rundeck, I created a new job with a script step with the following content:
curl -vvv -X POST http://admin:11bd72f1f22653cf7158c7961f60476a1d@localhost:8080/job/MyJenkinsJob/build

The format is the same as the Google Group post:

http://user:JENKINS_USER_TOKEN@localhost:8080/job/TestJob/build

Basically is the same way of calling any endpoint using the cURL tool.

Here is the job definition example (you can import job definitions to your instance following this).

- defaultTab: nodes
  description: ''
  executionEnabled: true
  id: 1fa2923a-5b1d-4ea2-97d1-4cc2a3726f07
  loglevel: INFO
  name: ExampleJENKINS
  nodeFilterEditable: false
  plugins:
    ExecutionLifecycle: null
  scheduleEnabled: true
  sequence:
    commands:
    - exec: echo "starting..."
    - fileExtension: .sh
      interpreterArgsQuoted: false
      script: curl -vvv -X POST http://admin:11bd72f1f22653cf7158c7961f60476a1d@localhost:8080/job/MyJenkinsJob/build
      scriptInterpreter: /bin/bash
    keepgoing: false
    strategy: node-first
  uuid: 1fa2923a-5b1d-4ea2-97d1-4cc2a3726f07

Alternatively, you can use the HTTP step plugin to call your Jenkins job easily, here you can see how to install the plugin, and here I left a job definition example:

- defaultTab: nodes
  description: ''
  executionEnabled: true
  id: 1fa2923a-5b1d-4ea2-97d1-4cc2a3726f07
  loglevel: INFO
  name: ExampleJENKINS
  nodeFilterEditable: false
  plugins:
    ExecutionLifecycle: null
  scheduleEnabled: true
  sequence:
    commands:
    - exec: echo "starting..."
    - configuration:
        authentication: Basic
        checkResponseCode: 'false'
        method: POST
        password: keys/jenkins_admin_token
        printResponse: 'false'
        printResponseToFile: 'false'
        proxySettings: 'false'
        remoteUrl: http://localhost:8080/job/MyJenkinsJob/build
        sslVerify: 'true'
        timeout: '30000'
        username: admin
      nodeStep: true
      type: edu.ohio.ais.rundeck.HttpWorkflowNodeStepPlugin
    keepgoing: false
    strategy: node-first
  uuid: 1fa2923a-5b1d-4ea2-97d1-4cc2a3726f07

The example uses basic authentication to pass the username and token (pulled from Rundeck Key Storage).

In both cases, the Jenkins job is launched from Rundeck.

Hope it helps!

Thank you so much for the help…i hope this will help me a lot to configure job in Rundeck.

1 Like